<?php

class MockFeedStorageAdapter implements IFeedStorageAdapter
{
    private $feeds;
    
    public function __construct()
    {
        $this->feeds = array();
    }
    
    public final static function GetStdFeed()
    {
        $feedAdapter = new self;
        $feedAdapter->setFeeds(array(
            'my-keyword' => array(),
        ));
        return $feedAdapter;
    }
    
    public final static function GetNoFeeds()
    {
        $feedAdapter = new self;
        $feedAdapter->setFeeds(array());
        return $feedAdapter;
    }

    public function setFeeds($feeds)
    {
        $this->feeds = $feeds;
    }
    
    public function hasFeed($name)
    {
        return array_key_exists($name,$this->feeds);
    }
    
    public function createFeed($name,$data=array(),$initialEntries=array())
    {
        if(!$name) throw new NullException("No name specified");
        
        $this->feeds[$name] = $initialEntries;
        
        return true;
    }
    
    public function getFeed($name)
    {
        throw new NotYetImplementedException("Feature not yet implemented");
    }
    
    public function getFeeds()
    {
        if(count($this->feeds)===0){
            throw new NotFoundException("No feeds");
        }
        throw new NotYetImplementedException("Feature not yet implemented");
    }
    
    public function deleteFeed($name)
    {
        throw new NotYetImplementedException("Feature not yet implemented");
    }
}
